#ifndef BSP_I2C_H
#define BSP_I2C_H

#include "esp_err.h"
#include "driver/i2c_master.h"
#include <stdint.h>
#include <stddef.h>

#ifdef __cplusplus
extern "C" {
#endif

// I2C Configuration Macros
#define I2C_MASTER_NUM 0
#define I2C_MASTER_SDA_IO 14
#define I2C_MASTER_SCL_IO 21
#define I2C_MASTER_FREQ_HZ 400000
#define I2C_MASTER_TIMEOUT_MS 1000

// I2C Function Declarations
esp_err_t bsp_i2c_init(i2c_master_bus_handle_t *bus_handle, i2c_master_dev_handle_t *dev_handle);
esp_err_t bsp_i2c_add_device(i2c_master_bus_handle_t bus_handle, i2c_master_dev_handle_t *dev_handle, uint8_t addr);

#ifdef __cplusplus
}
#endif

#endif // BSP_I2C_H
